package com.xiami.exception;

import com.xiami.pojo.MyResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/*
创建者:虾米糖
时间:2020/4/16 16:06
描述:全局异常处理
*/
@RestControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(Exception.class)
    public MyResponseResult ex(Exception ex){
    ex.printStackTrace();
        return MyResponseResult.error("操作失败");
    }
}
